<?php


namespace App\Command\syncdata;


use App\Web\Model\CaseModel;
use EchoPHP\Console\Command;

/**
 * 将case中的简历数据同步到redis中，测试9w条记录可以较短时间内同步完成，但tuxedo限制最多只能返回65535条记录，暂不考虑这个限制
 * Class CaseResumeCount
 * @package App\Command\syncdata
 */
class CaseResumeCount extends Command {
    protected $signature = "syncdata:caseresumecount {caseid : '需要同步的caseid'}";
    protected $description = '重置caseid存放在redis中的数据';

    public function handle() {
        $caseId = $this->argument('caseid');

        $caseModel = new CaseModel();
        $result = $caseModel->resyncCaseResumeCountReport($caseId);
        switch ($result) {
            case -1:
                $this->output->error('该职位没有简历数据');
                break;
            case 0:
                $this->output->success('同步完成');
                break;
        }
    }
}